<!--
 * @Date: 2022-11-07 10:52:20
 * @LastEditors: sailornpg
 * @LastEditTime: 2022-11-29 13:11:12
 * @FilePath: \vue-admin-ts\src\views\main\index.vue
 * @Description: home
-->
<template>
  <div class="main">
    <el-container class="main-content">
      <el-aside :width="isOpenFalg ? '210px' : '60px'">
        <nav-menu :collapseFlag="isOpenFalg"></nav-menu>
      </el-aside>
      <el-container class="page">
        <el-header class="page-header">
          <nav-header @open-change="openChange"></nav-header>
        </el-header>
        <el-main class="page-content">
          <div class="page-info">
            <router-view></router-view>
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script lang="ts" setup>
import navMenu from "./components/NavMenu/index.vue";
import NavHeader from "./components/NavHeader/index.vue";
import { ref } from "vue";
const isOpenFalg = ref(true);
const openChange = (isOpen: boolean) => {
  isOpenFalg.value = isOpen;
};
</script>
<style lang="less" scoped>
.main {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.main-content,
.page {
  height: 100%;
}

.page-content {
  height: calc(100% - 48px);

  .page-info {
    background-color: #fff;
    border-radius: 5px;
    // height: 100%;
  }
}

.el-header,
.el-footer {
  display: flex;
  color: #333;
  text-align: center;
  align-items: center;
}

.el-header {
  height: 48px !important;
}

.el-aside {
  overflow-x: hidden;
  overflow-y: auto;
  line-height: 200px;
  text-align: left;
  cursor: pointer;
  background-color: #001529;
  transition: width 0.3s linear;
  scrollbar-width: none; /* firefox */
  -ms-overflow-style: none; /* IE 10+ */

  &::-webkit-scrollbar {
    display: none;
  }
}

.el-main {
  color: #333;
  text-align: center;
  background-color: #f0f2f5;
}
</style>
